package com.ylbh.modules.newinfo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.newinfo.dto.AddNewInfoDTO;
import com.ylbh.common.pojo.newinfo.dto.NewInfoDetailsDTO;
import com.ylbh.common.pojo.newinfo.dto.NewInfoListDTO;
import com.ylbh.common.pojo.newinfo.vo.NewInfoDetailsVO;
import com.ylbh.common.pojo.newinfo.vo.NewInfoListVO;
import com.ylbh.common.pojo.newinfo.vo.NewsClassVO;
import com.ylbh.modules.newinfo.entity.ShoppingNewsInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 *
 *
 * @author czx
 * @date 2019-04-11 10:31:38
 */
@Mapper
@Repository
public interface ShoppingNewsInfoMapper extends BaseMapper<ShoppingNewsInfo> {

    /**
     * 新闻内容列表
     * @param newInfoListDTO
     * @param page
     * @return
     */
    List<NewInfoListVO> selectNewInfoList(@Param(value = "newInfoListDTO") NewInfoListDTO newInfoListDTO, Page page);

    /**
     * 新闻内容详情
     * @param newsId
     * @return
     */
    NewInfoDetailsVO selectNewInfoDetailsByNewsId(@Param(value = "newsId")String newsId);

    /**
     * 修改新闻内容
     * @param newInfoDetailsDTO
     */
    void updateNewInfoByNewsId(@Param(value = "newInfoDetailsDTO")NewInfoDetailsDTO newInfoDetailsDTO);

    /**
     * 删除新闻
     * @param list
     */
    void deleteNewInfoByNewsIds(@Param(value = "list")List<String> list);

    /**
     * 新增新闻
     * @param addNewInfoDTO
     */
    void insertNewsInfo(@Param(value = "addNewInfoDTO")AddNewInfoDTO addNewInfoDTO);

    /**
     * 获取全部分类
     * @return
     */
    List<NewsClassVO> selectClass();
}
